package cn.ming.leo.utils;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.avaje.ebean.PagedList;

/**
 * @author liaozhida
 * 分页模型
 * @param <T>
 */
public class PageListModelSecond<T> {
	//总条数
	private int rowTotal;
	//总页数
	private int pageTotal;
	//集合
	private List<T> list;
	
	//集合大小
	private int listSize ;

	private String  amount ;
	
	public PageListModelSecond(){
	}
	
	/**对象集合 总页数 总体条数
	 * @param value
	 * @param pageTotal
	 * @param rowTotal
	 */
	public PageListModelSecond(List<T> value,int pageTotal,int rowTotal,String amount) {
		this.list = value;
		this.listSize = this.list.size();
		this.pageTotal = pageTotal;
		this.rowTotal = rowTotal;
		this.amount =amount;
	}
	
	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public PageListModelSecond(PagedList<T> pl,String amount){
		pl.getTotalPageCount();
		this.rowTotal = pl.getTotalRowCount();
		this.list = pl.getList();
		this.pageTotal = pl.getTotalPageCount();
		this.listSize = this.list.size();
		this.amount =amount;
	}

	public int getRowTotal() {
		return rowTotal;
	}

	public void setRowTotal(int rowTotal) {
		this.rowTotal = rowTotal;
	}

	public int getPageTotal() {
		return pageTotal;
	}

	public void setPageTotal(int pageTotal) {
		this.pageTotal = pageTotal;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
		this.listSize = list.size();
	}
	

	public int getListSize() {
		return listSize;
	}

	public void setListSize(int listSize) {
		this.listSize = listSize;
	}

	@Override
	public String toString() {
		return "PageListModel [rowTotal=" + rowTotal + ", pageTotal="
				+ pageTotal + ", list=" + list + ", listSize=" + listSize + "]";
	}


}

